package net.m2m.apbnm.PolicyEditor.client;




import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.StackLayoutPanel;
import com.google.gwt.user.client.ui.TabLayoutPanel;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.cellview.client.CellTree;
import com.google.gwt.view.client.TreeViewModel;
import com.google.gwt.view.client.ListDataProvider;
import com.google.gwt.view.client.TreeViewModel.NodeInfo;
import com.google.gwt.cell.client.TextCell;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.Cell;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSelectionPolicy;
import com.google.gwt.user.cellview.client.TreeNode;
import com.google.gwt.view.client.SingleSelectionModel;

import java.util.ArrayList;
import java.util.List;
import java.util.Date;

import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;


public class PolicyEditor implements EntryPoint {
	private static class Playlist {
	    private final String name;
	    private final List<String> songs = new ArrayList<String>();

	    public Playlist(String name) {
	      this.name = name;
	    }

	    /**
	     * Add a song to the playlist.
	     * 
	     * @param name the name of the song
	     */
	    public void addSong(String name) {
	      songs.add(name);
	    }

	    public String getName() {
	      return name;
	    }

	    /**
	     * Return the list of songs in the playlist.
	     */
	    public List<String> getSongs() {
	      return songs;
	    }
	  }

	  /**
	   * A composer of classical music.
	   */
	  private static class Composer {
	    private final String name;
	    private final List<Playlist> playlists = new ArrayList<Playlist>();

	    public Composer(String name) {
	      this.name = name;
	    }

	    /**
	     * Add a playlist to the composer.
	     * 
	     * @param playlist the playlist to add
	     */
	    public Playlist addPlaylist(Playlist playlist) {
	      playlists.add(playlist);
	      return playlist;
	    }

	    public String getName() {
	      return name;
	    }

	    /**
	     * Return the rockin' playlist for this composer.
	     */
	    public List<Playlist> getPlaylists() {
	      return playlists;
	    }
	  }
	
	///////////////////////////////////////
	//Cell Tree
	  private static class CustomTreeModel implements TreeViewModel {

		    private final List<Composer> composers;

		    /**
		     * This selection model is shared across all leaf nodes. A selection model
		     * can also be shared across all nodes in the tree, or each set of child
		     * nodes can have its own instance. This gives you flexibility to determine
		     * how nodes are selected.
		     */
		    private final SingleSelectionModel<String> selectionModel = new SingleSelectionModel<String>();

		    public CustomTreeModel() {
		      // Create a database of information.
		      composers = new ArrayList<Composer>();

		      // Add compositions by Beethoven.
		      {
		        Composer beethoven = new Composer("Editing Tool");
		        composers.add(beethoven);

		        Playlist concertos = beethoven.addPlaylist(new Playlist("policy editor"));
		        concertos.addSong("Create/Edit Policy");
		        concertos.addSong("Modify Policy");
		        
		        
		        Playlist quartets = beethoven.addPlaylist(new Playlist("policy compiler"));
		        quartets.addSong("XML Translator");
		        quartets.addSong("JSON Translator");
		        
		      }
		      
		      
		      {
			        Composer beethoven = new Composer("Monitoring Tool");
			        composers.add(beethoven);

			        Playlist concertos = beethoven.addPlaylist(new Playlist("sensory-profile"));
			        concertos.addSong("EKG");
			        concertos.addSong("Blood Pressure");
			        concertos.addSong("Pulse Oximeter");
			        concertos.addSong("Temperature");
			        
			        Playlist quartets = beethoven.addPlaylist(new Playlist("sensor-value"));
			        quartets.addSong("Single Value");
			        quartets.addSong("Double Value");
			        quartets.addSong("Multiple Value");

			        Playlist sonatas = beethoven.addPlaylist(new Playlist("actuator"));
			        sonatas.addSong("Communication Interval");
			        sonatas.addSong("Sensing Interval");

			        
			      }

		      
		      {
			        Composer beethoven = new Composer("Management Tool");
			        composers.add(beethoven);

			        Playlist concertos = beethoven.addPlaylist(new Playlist("policy conflict resolver"));
			        concertos.addSong("conflict detector");
			        concertos.addSong("conflict resolver");
			        concertos.addSong("log");
			        
			        
			        Playlist quartets = beethoven.addPlaylist(new Playlist("autonomic learner"));
			        quartets.addSong("present info");
			        quartets.addSong("previous observations");
			        quartets.addSong("log");

			        
			      }


		      // Add compositions by Brahms.
		      
		    }

		    /**
		     * Get the {@link NodeInfo} that provides the children of the specified
		     * value.
		     */
		    public <T> NodeInfo<?> getNodeInfo(T value) {
		      if (value == null) {
		        // LEVEL 0.
		        // We passed null as the root value. Return the composers.

		        // Create a data provider that contains the list of composers.
		        ListDataProvider<Composer> dataProvider = new ListDataProvider<PolicyEditor.Composer>(
		            composers);

		        // Create a cell to display a composer.
		        Cell<Composer> cell = new AbstractCell<Composer>() {
		          @Override
		          public void render(Context context, Composer value, SafeHtmlBuilder sb) {
		            if (value != null) {
		              sb.appendEscaped(value.getName());
		            }
		          }
		        };

		        // Return a node info that pairs the data provider and the cell.
		        return new DefaultNodeInfo<Composer>(dataProvider, cell);
		      } else if (value instanceof Composer) {
		        // LEVEL 1.
		        // We want the children of the composer. Return the playlists.
		        ListDataProvider<Playlist> dataProvider = new ListDataProvider<Playlist>(
		            ((Composer) value).getPlaylists());
		        Cell<Playlist> cell = new AbstractCell<Playlist>() {
		          @Override
		          public void render(Context context, Playlist value, SafeHtmlBuilder sb) {
		            if (value != null) {
		              sb.appendEscaped(value.getName());
		            }
		          }
		        };
		        return new DefaultNodeInfo<Playlist>(dataProvider, cell);
		      } else if (value instanceof Playlist) {
		        // LEVEL 2 - LEAF.
		        // We want the children of the playlist. Return the songs.
		        ListDataProvider<String> dataProvider = new ListDataProvider<String>(
		            ((Playlist) value).getSongs());

		        // Use the shared selection model.
		        return new DefaultNodeInfo<String>(dataProvider, new TextCell(),
		            selectionModel, null);
		      }

		      return null;
		    }

		    /**
		     * Check if the specified value represents a leaf node. Leaf nodes cannot be
		     * opened.
		     */
		    public boolean isLeaf(Object value) {
		      // The leaf nodes are the songs, which are Strings.
		      if (value instanceof String) {
		        return true;
		      }
		      return false;
		    }

		  }
	

	
	
	//////////////////////////////////////
	

	  
	public void onModuleLoad() {
		RootPanel rootPanel = RootPanel.get();
		
		
		//Navigation Bar
		AbsolutePanel absolutePanel = new AbsolutePanel();
		absolutePanel.setStyleName("body");
		rootPanel.add(absolutePanel, 10, 10);
		absolutePanel.setSize("203px", "555px");
		
		
		
		
		TreeViewModel model = new CustomTreeModel();
		CellTree cellTree = new CellTree(model,null);
		cellTree.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);

		    // Open the first playlist by default.
		TreeNode rootNode = cellTree.getRootTreeNode();
		TreeNode firstPlaylist = rootNode.setChildOpen(0, true);
		firstPlaylist.setChildOpen(0, true);

		absolutePanel.add(cellTree, 26, 101);
		cellTree.setSize("150px", "100px");
		
		
		
	   //CellTree tree = new CellTree(model,null);
			 
				   
		
		
		
		
		//Menu Bar
		AbsolutePanel absolutePanel_1 = new AbsolutePanel();
		rootPanel.add(absolutePanel_1, 219, 10);
		absolutePanel_1.setSize("458px", "45px");
		
		//Body Bar
		AbsolutePanel absolutePanel_2 = new AbsolutePanel();
		rootPanel.add(absolutePanel_2, 219, 61);
		absolutePanel_2.setSize("563px", "230px");
		
		
		////////////////////////////////////////////////////
		
		
		
		/*
		CellTable<Contact> table = new CellTable<Contact>();

	    
	    

	    TextColumn<Contact> eventColumn = new TextColumn<Contact>() {
		      @Override
		      public String getValue(Contact contact) {
		        return contact.eventName;
		      }
		    };

		TextColumn<Contact> hearrateColumn = new TextColumn<Contact>() {
			      @Override
			      public String getValue(Contact contact) {
			        return contact.heartrate;
			      }
			    };

	    
        TextColumn<Contact> systolicbpColumn = new TextColumn<Contact>() {
				      @Override
				      public String getValue(Contact contact) {
				        return contact.systolicbp;
				      }
				    };

		 TextColumn<Contact> diastolicColumn = new TextColumn<Contact>() {
					      @Override
					      public String getValue(Contact contact) {
					        return contact.diastolicbp;
					      }
					    };
	    
					    TextColumn<Contact> temperaturecol = new TextColumn<Contact>() {
						      @Override
						      public String getValue(Contact contact) {
						        return contact.temperaturerate;
						      }
						    };
		
					    
						    
      TextColumn<Contact> statusdrugdose = new TextColumn<Contact>() {
							      @Override
							      public String getValue(Contact contact) {
							        return contact.statusdrugdose;
							      }
							    };
			    
		    
					    
	     
	    // Add the columns.
	    
	    table.addColumn(eventColumn, "Event");
	    table.addColumn(hearrateColumn, "Heart Rate");
	    table.addColumn(systolicbpColumn, "Systolic Pressure");
	    table.addColumn(systolicbpColumn, "Diastolic Pressure");
	    table.addColumn(diastolicColumn, "Temperature");
	    table.addColumn(statusdrugdose, "Drug Dose");
	    
	    
	    
	    // Set the width of the table and put the table in fixed width mode.
	    
	    
	    table.setWidth("100%", true);

	    
	    // Set the width of each column.
	    //table.setColumnWidth(policyColumn, 25.0, Unit.PCT);
	    table.setColumnWidth(eventColumn, 15.0, Unit.PCT);
	    table.setColumnWidth(hearrateColumn, 15.0, Unit.PCT);
	    table.setColumnWidth(systolicbpColumn, 15.0, Unit.PCT);
	    table.setColumnWidth(diastolicColumn, 15.0, Unit.PCT);
	    table.setColumnWidth(temperaturecol, 15.0, Unit.PCT);
	    //table.setColumnWidth(actionstatus, 25.0, Unit.PCT);
	    table.setColumnWidth(statusdrugdose, 15.0, Unit.PCT);
      
	    
	   // table.setWidth("auto", true);
	    
	    
	    
	    // Set the total row count. This isn't strictly necessary, but it affects
	    // paging calculations, so its good habit to keep the row count up to date.
	    table.setRowCount(CONTACTS.size(), true);
      
	    // Push the data into the widget.
	    table.setRowData(0, CONTACTS);

	    
	    absolutePanel_2.add(table, 10, 22);
		table.setSize("444px", "600px");
		*/
		
		//absolutePanel_2.add(new MemoryPagingGridExample());
		
		absolutePanel_2.add(getViewPanel(), 0, 0);
		
		
		
		// Add it to the root panel.
	    ///////////////////////////////////////////
		
		
		
		//Tab Bar
		TabLayoutPanel tabLayoutPanel = new TabLayoutPanel(1.5, Unit.EM);
						
		
		////////////////////////////////////
		//Defining Policy Description
		StackLayoutPanel p1 = new StackLayoutPanel(Unit.EM);
		
		

		//Adding a TextArea
		TextArea ta0 = new TextArea();
		ta0.setCharacterWidth(20);
		ta0.setVisibleLines(1);
		ta0.setText("VeryLowDrugDosePolicy");
		p1.add(ta0, "Name", 2);
				
		
		
		//Adding a TextArea
		TextArea ta = new TextArea();
	    ta.setCharacterWidth(20);
	    ta.setVisibleLines(3);
	    ta.setText("Policy defines in which condition Very Low  Drug Dose is applicable");
	    p1.add(ta, "Description", 2);
		p1.add(new HTML("2012.04.23"), new HTML("Creation Time"),2);
		
	    //Adding Administrator
		ListBox lb1=new ListBox();
		lb1.addItem("Administrator 1");
		lb1.addItem("Administrator 2");
		lb1.addItem("Administrator 3");
		lb1.setVisibleItemCount(3);
		
		p1.add(lb1, new HTML("Created By"), 2);
				
		tabLayoutPanel.add(p1, "[Policy]");
		///////////////////////////////////////////////////////////////
		
		
				 
				 tabLayoutPanel.add(new HTML("Very Low Drug Dose Event"), "[Event]");
		
		//////////////////////////////////////////////////
				//Defining Condition
				StackLayoutPanel p3 = new StackLayoutPanel(Unit.EM);
				
				//Adding heart rate
			    RadioButton rb0 = new RadioButton("myRadioGroup", "A>170   ");
				RadioButton rb1 = new RadioButton("myRadioGroup", "100<A<170  ");
				RadioButton rb2 = new RadioButton("myRadioGroup", "70<A<100");
				rb0.setChecked(true);
				FlowPanel fpanel1 = new FlowPanel();
				fpanel1.add(rb0);
				fpanel1.add(rb1);
				fpanel1.add(rb2);
				p3.add(fpanel1, new HTML("Heart Rate"), 2);
					
				//Adding Blood pressure
				
				Label systolicBPLevel=new Label("Systolic Pressure");
				
				RadioButton rb3 = new RadioButton("myRadioGroup", "B>180   ");
				RadioButton rb4 = new RadioButton("myRadioGroup", "160<B<180  ");
				RadioButton rb5 = new RadioButton("myRadioGroup", "70<B<100");
				RadioButton rb55 = new RadioButton("myRadioGroup", "70<B<100");
				
				
				rb3.setChecked(true);
				
				
				FlowPanel fpanel2 = new FlowPanel();
				FlowPanel fpanel3 = new FlowPanel();
				FlowPanel fpanel4 = new FlowPanel();
				
				fpanel2.add(systolicBPLevel);
				fpanel2.add(rb3);
				fpanel2.add(rb4);
				fpanel2.add(rb5);
				fpanel2.add(rb55);
				
              
				Label diastolicBPLevel=new Label("Diastolic Pressure");
				
				RadioButton rb6 = new RadioButton("myRadioGroup", "C>110   ");
				RadioButton rb7 = new RadioButton("myRadioGroup", "100<C<110  ");
				RadioButton rb8 = new RadioButton("myRadioGroup", "90<C<100");
				RadioButton rb88 = new RadioButton("myRadioGroup", "80<C<90");
				
				rb6.setChecked(true);
				
				fpanel3.add(diastolicBPLevel);
				fpanel3.add(rb6);
				fpanel3.add(rb7);
				fpanel3.add(rb8);
				fpanel3.add(rb88);
								
				fpanel4.add(fpanel2);
				fpanel4.add(fpanel3);
				
				p3.add(fpanel4, new HTML("Blood Pressure"), 2);
				
				//Adding Temperature
				
				
				 RadioButton rb9 = new RadioButton("myRadioGroup", "D>40   ");
				 RadioButton rb10 = new RadioButton("myRadioGroup", "38.5<D<40  ");
				 RadioButton rb11 = new RadioButton("myRadioGroup", "37<D<38.5");
				 RadioButton rb12 = new RadioButton("myRadioGroup", "36<D<37");
					
				rb9.setChecked(true);
				FlowPanel fpanel5 = new FlowPanel();
				fpanel5.add(rb9);
				fpanel5.add(rb10);
				fpanel5.add(rb11);
				fpanel5.add(rb12);
				p3.add(fpanel5, new HTML("Temperature"), 2);
				
			    tabLayoutPanel.add(p3, "[Condition]");
		
		//////////////////////////////////////////////////
		
			    
			    StackLayoutPanel p4 = new StackLayoutPanel(Unit.EM);
				
			    //Defining Status
			    RadioButton rb13 = new RadioButton("myRadioGroup", "Critical  ");
				RadioButton rb14 = new RadioButton("myRadioGroup", "Alarming  ");
				RadioButton rb15 = new RadioButton("myRadioGroup", "Prone     ");
				RadioButton rb16 = new RadioButton("myRadioGroup", "Normal   ");
				
				rb13.setChecked(true);
				FlowPanel fpanel6 = new FlowPanel();
				
				fpanel6.add(rb13);
				fpanel6.add(rb14);
				fpanel6.add(rb15);
				fpanel6.add(rb16);
				
				p4.add(fpanel6, new HTML("Status "), 2);
				
				
				//Defining Drug Dose
				  RadioButton rb17 = new RadioButton("myRadioGroup", "Very Low  ");
					RadioButton rb18 = new RadioButton("myRadioGroup", "Low  ");
					RadioButton rb19 = new RadioButton("myRadioGroup", "Medium     ");
					RadioButton rb20 = new RadioButton("myRadioGroup", "Optimum   ");
					
					rb13.setChecked(true);
					FlowPanel fpanel7 = new FlowPanel();
					
					fpanel7.add(rb17);
					fpanel7.add(rb18);
					fpanel7.add(rb19);
					fpanel7.add(rb20);
					
					p4.add(fpanel7, new HTML("Drug Dose "), 2);
				
				
				
				
				
				tabLayoutPanel.add(p4, "[Action]");
		
		////////////////////////////////////
		
		rootPanel.add(tabLayoutPanel, 219, 297);
		tabLayoutPanel.setSize("500px", "268px");
		
		
		
		
		
	}
	
	
	
	  public Canvas getViewPanel() {

		    final ListGrid countryGrid = new ListGrid();
		    countryGrid.setSize("474px", "224px");
		    countryGrid.setWidth(500);
		    countryGrid.setHeight(224);
		    countryGrid.setAlternateRecordStyles(true);
		    countryGrid.setShowAllRecords(true);

		    
		    
		    
		    
		    
		    ListGridField populationField = new ListGridField("population", "Policy",10);
		    populationField.setType(ListGridFieldType.INTEGER);
		    ListGridField continentField = new ListGridField("continent", "Event");
		    ListGridField nameField = new ListGridField("countryName", "Heartrate");
		    ListGridField countryCodeField = new ListGridField("countryCode", "Systolic Pressure");
		    ListGridField governmentField = new ListGridField("government", "Diastolic Pressure");
		    ListGridField capitalField = new ListGridField("capital", "Temperature");
		    ListGridField articleField = new ListGridField("article", "Status");
		    ListGridField backgroundField = new ListGridField("background", "Drug Dose");
		    
		    
		    
		    
		    
		    //setPopulation(population);
		    //setContinent(continent);
		    //setCountryName(countryName);
		    //setCountryCode(countryCode);
		    //setGovernment(government);
		    //setCapital(capital);
		    //setArticle(article);
		    //setBackground(background);
		    
		    
		    countryGrid.setFields(new ListGridField[] {populationField,continentField,nameField,countryCodeField,governmentField,capitalField, 
		    		articleField, backgroundField});
		    countryGrid.setCanResizeFields(true);
		    countryGrid.setData(CountryData.getRecords());

		    return countryGrid;
		  }
	  
	  

}


class CountryRecord extends ListGridRecord {

	  public CountryRecord() {
	  }

	  public CountryRecord(String countryCode, String countryName, String capital, String continent) {
	    setCountryCode(countryCode);
	    setCountryName(countryName);
	    setCapital(capital);
	    setContinent(continent);
	  }

	  public CountryRecord(String countryCode, String countryName, int population) {
	    setCountryCode(countryCode);
	    setCountryName(countryName);
	    setPopulation(population);
	  }

	//String continent, String countryName, String countryCode,
	  // String government, 
	  //String capital, String article, String background
	  

	  public CountryRecord(int population,String continent, String countryName, String countryCode,
		      String government,
		      String capital,String article, String background) {

		    setPopulation(population);
		    setContinent(continent);
		    setCountryName(countryName);
		    setCountryCode(countryCode);
		    setGovernment(government);
		    setCapital(capital);
		    setArticle(article);
		    setBackground(background);
		  }

	  
	
	  public void setContinent(String continent) {
	    setAttribute("continent", continent);
	  }

	  public String getContinent() {
	    return getAttributeAsString("continent");
	  }

	
	  
	  public void setCountryName(String countryName) {
	    setAttribute("countryName", countryName);
	  }

	  public String getCountryName() {
	    return getAttributeAsString("countryName");
	  }

	  
	  
	  
	  
	  public void setCountryCode(String countryCode) {
	    setAttribute("countryCode", countryCode);
	  }

	  public String getCountryCode() {
	    return getAttributeAsString("countryCode");
	  }

	  
	  
	  
	  
	  public void setArea(int area) {
	    setAttribute("area", area);
	  }

	  public int getArea() {
	    return getAttributeAsInt("area");
	  }

	  public void setPopulation(int population) {
	    setAttribute("population", population);
	  }

	  public int getPopulation() {
	    return getAttributeAsInt("population");
	  }

	  public void setGdp(double gdp) {
	    setAttribute("gdp", gdp);
	  }

	  public double getGdp() {
	    return getAttributeAsDouble("gdp");
	  }

	  public void setIndependence(Date independence) {
	    setAttribute("independence", independence);
	  }

	  public Date getIndependence() {
	    return getAttributeAsDate("independence");
	  }

	  public void setGovernment(String government) {
	    setAttribute("government", government);
	  }

	  public String getGovernment() {
	    return getAttributeAsString("government");
	  }

	  public void setGovernmentDesc(int governmentDesc) {
	    setAttribute("government_desc", governmentDesc);
	  }

	  public int getGovernmentDesc() {
	    return getAttributeAsInt("government_desc");
	  }

	  public void setCapital(String capital) {
	    setAttribute("capital", capital);
	  }

	  public String getCapital() {
	    return getAttributeAsString("capital");
	  }

	  public void setMemberG8(boolean memberG8) {
	    setAttribute("member_g8", memberG8);
	  }

	  public boolean getMemberG8() {
	    return getAttributeAsBoolean("member_g8");
	  }

	  public void setArticle(String article) {
	    setAttribute("article", article);
	  }

	  public String getArticle() {
	    return getAttributeAsString("article");
	  }

	  public void setBackground(String background) {
	    setAttribute("background", background);
	  }

	  public String getBackground() {
	    return getAttributeAsString("background");
	  }

	  public String getFieldValue(String field) {
	    return getAttributeAsString(field);
	  }
	}

	class CountryData {

	  private static CountryRecord[] records;

	  public static CountryRecord[] getRecords() {
	    if (records == null) {
	      records = getNewRecords();
	    }
	    return records;
	  }

	  public static CountryRecord[] getNewRecords() {
	    return new CountryRecord[] {
	    		//String continent, String countryName, String countryCode,
	    	      // String government, 
	    	      //String capital, String article, String background
	    		
	    		new CountryRecord(
	    				1,
	    	            "Very Low Drug Dose",
	    	            "A>170",
	    	            "B>180",
	    	            "C>110",
	    	            "D>40",
	    	            "Critical",
	    	            "Very Low"),
	    		
	    	            new CountryRecord(
	    	    				2,
	    	    	            "Low Drug Dose",
	    	    	            "A>100 && A<170",
	    	    	            "B>160 && B<180",
	    	    	            "C>100 && C<110",
	    	    	            "D>38.5 && D<40",
	    	    	            "Alarming",
	    	    	            "Low"),
	    	    	            
	    	    	    new CountryRecord(
	    	    	    				3,
	    	    	    	            "Medium Drug Dose",
	    	    	    	            "A>70 && A<100",
	    	    	    	            "B>140 && B<160",
	    	    	    	            "C> 90 && C<100",
	    	    	    	            "D>37 && D<38.5",
	    	    	    	            "Prone",
	    	    	    	            "Medium"),
	    	    	    new CountryRecord(
	    	    	    	    				4,
	    	    	    	    	            "Optimum Drug Dose",
	    	    	    	    	            "A>70 && A<100",
	    	    	    	    	            "B>120 && B<140",
	    	    	    	    	            "C>80 && C<90",
	    	    	    	    	            "D>36 && D<37",
	    	    	    	    	            "Normal",
	    	    	    	    	            "Optimum"),
	    	    	    	    		
	    	    	    		
	    	    	    	    	            new CountryRecord(
	    	    	    	    	    				5,
	    	    	    	    	    	            "Very Low Drug Dose",
	    	    	    	    	    	            "A>170",
	    	    	    	    	    	            "B>180",
	    	    	    	    	    	            "C>110",
	    	    	    	    	    	            "D>40",
	    	    	    	    	    	            "Critical",
	    	    	    	    	    	            "Very Low"),
	    	    	    	    	    		
	    	    	    	    	    	            new CountryRecord(
	    	    	    	    	    	    				6,
	    	    	    	    	    	    	            "Low Drug Dose",
	    	    	    	    	    	    	            "A>100 && A<170",
	    	    	    	    	    	    	            "B>160 && B<180",
	    	    	    	    	    	    	            "C>100 && C<110",
	    	    	    	    	    	    	            "D>38.5 && D<40",
	    	    	    	    	    	    	            "Alarming",
	    	    	    	    	    	    	            "Low"),
	    	    	    	    	    	    	            
	    	    	    	    	    	    	    new CountryRecord(
	    	    	    	    	    	    	    				7,
	    	    	    	    	    	    	    	            "Medium Drug Dose",
	    	    	    	    	    	    	    	            "A>70 && A<100",
	    	    	    	    	    	    	    	            "B>140 && B<160",
	    	    	    	    	    	    	    	            "C> 90 && C<100",
	    	    	    	    	    	    	    	            "D>37 && D<38.5",
	    	    	    	    	    	    	    	            "Prone",
	    	    	    	    	    	    	    	            "Medium"),
	    	    	    	    	    	    	    new CountryRecord(
	    	    	    	    	    	    	    	    				8,
	    	    	    	    	    	    	    	    	            "Optimum Drug Dose",
	    	    	    	    	    	    	    	    	            "A>70 && A<100",
	    	    	    	    	    	    	    	    	            "B>120 && B<140",
	    	    	    	    	    	    	    	    	            "C>80 && C<90",
	    	    	    	    	    	    	    	    	            "D>36 && D<37",
	    	    	    	    	    	    	    	    	            "Normal",
	    	    	    	    	    	    	    	    	            "Optimum")
	    	    	    	    	    	    	    	    	    	    	    	    	    	            
	    		 };
	  }
	}




